ARG BASE_IMAGE=ubuntu:22.04
FROM $BASE_IMAGE
SHELL [ "/bin/bash", "-c"]
# Set locales
ENV LANG=en_US.UTF-8
ENV TZ=Asia/Shanghai
# Set USER
ENV USER=docker \
    PASSWD=docker \
    UID=1001 \
    GID=1001
# Set display
ENV SIZEW=1920 \
    SIZEH=1080 \
    FPS=60 \
    DPI=96
ENV VGL_DISPLAY=egl
ENV DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket
ENV DEBIAN_FRONTEND=noninteractive
# Make all NVIDIA GPUs visible by default
ENV NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:-all}
# All NVIDIA driver capabilities should preferably be used, check `NVIDIA_DRIVER_CAPABILITIES` inside the container if things do not work
ENV NVIDIA_DRIVER_CAPABILITIES=all

ADD scripts/ /scripts/
RUN bash /scripts/common.sh
RUN bash /scripts/display.sh
RUN bash /scripts/vnc.sh
RUN bash /scripts/nomachine.sh
# RUN /scripts/chrome.sh
# Clean up
# RUN rm -rf /var/lib/apt/lists/*
CMD [ "bash", "/scripts/startup.sh", "bash"]